﻿using System;
using System.Collections.Generic;
using System.Text;

using libReadWrite;
using libCommonClass;

namespace TTServer.Messages
{
    public class PPTGoToSlideRequestMessage : TTMessage
    {
        private String _temporaryKey = "";

        public String TemporaryKey
        {
            get { return _temporaryKey; }
            set { _temporaryKey = value; }
        }

        private int _slideIndex = -1;

        public int SlideIndex
        {
            get { return _slideIndex; }
        }

        public PPTGoToSlideRequestMessage()
        {

        }

        public override void ReadMessage(BigEndianReader sr)
        {
            this.TemporaryKey = sr.ReadString();

            try
            {
                int temp = sr.ReadInt32();
                _slideIndex = temp;
            }
            catch
            {
                _slideIndex = -1;
            }
        }

        public override void WriteMessage(BigEndianWriter sw)
        {
            throw new NotImplementedException();
        }

        public override TTMessage Clone()
        {
            return new PPTGoToSlideRequestMessage();
        }

        public override int GetMessageID()
        {
            return MessageKind.GO_TO_SLIDE;
        }

        public override string GetMessageName()
        {
            return "PPTGoToSlideRequestMessage";
        }
    }
}
